// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview A centralized listing for keycodes used by accessibility
 * component extensions. Largely taken from
 * ui/events/keycodes/keyboard_codes_posix.h, but with specific edits for Chrome
 * OS and accessibility.
 */

goog.provide('KeyCode');

/** @enum {number} */
KeyCode = {
  CANCEL: 3,
  BACK: 8,
  TAB: 9,
  BACKTAB: 10,
  CLEAR: 12,
  RETURN: 13,
  SHIFT: 16,
  CONTROL: 17,
  MENU: 18,
  ALT: 18,
  PAUSE: 19,
  CAPITAL: 20,
  KANA: 21,
  HANGUL: 21,
  PASTE: 22,
  JUNJA: 23,
  FINAL: 24,
  HANJA: 25,
  KANJI: 25,
  ESCAPE: 27,
  CONVERT: 28,
  NONCONVERT: 29,
  ACCEPT: 30,
  MODECHANGE: 31,
  SPACE: 32,
  PRIOR: 33,
  NEXT: 34,
  END: 35,
  HOME: 36,
  LEFT: 37,
  UP: 38,
  RIGHT: 39,
  DOWN: 40,
  SELECT: 41,
  PRINT: 42,
  EXECUTE: 43,
  SNAPSHOT: 44,
  INSERT: 45,
  DELETE: 46,
  HELP: 47,
  ZERO: 48,
  ONE: 49,
  TWO: 50,
  THREE: 51,
  FOUR: 52,
  FIVE: 53,
  SIX: 54,
  SEVEN: 55,
  EIGHT: 56,
  NINE: 57,
  A: 65,
  B: 66,
  C: 67,
  D: 68,
  E: 69,
  F: 70,
  G: 71,
  H: 72,
  I: 73,
  J: 74,
  K: 75,
  L: 76,
  M: 77,
  N: 78,
  O: 79,
  P: 80,
  Q: 81,
  R: 82,
  S: 83,
  T: 84,
  U: 85,
  V: 86,
  W: 87,
  X: 88,
  Y: 89,
  Z: 90,
  SEARCH: 91,
  RWIN: 92,
  APPS: 93,
  SLEEP: 95,
  NUMPAD0: 96,
  NUMPAD1: 97,
  NUMPAD2: 98,
  NUMPAD3: 99,
  NUMPAD4: 100,
  NUMPAD5: 101,
  NUMPAD6: 102,
  NUMPAD7: 103,
  NUMPAD8: 104,
  NUMPAD9: 105,
  MULTIPLY: 106,
  ADD: 107,
  SEPARATOR: 108,
  SUBTRACT: 109,
  DECIMAL: 110,
  DIVIDE: 111,
  F1: 112,
  F2: 113,
  F3: 114,
  F4: 115,
  F5: 116,
  F6: 117,
  F7: 118,
  F8: 119,
  F9: 120,
  F10: 121,
  F11: 122,
  F12: 123,
  F13: 124,
  F14: 125,
  F15: 126,
  F16: 127,
  F17: 128,
  F18: 129,
  F19: 130,
  F20: 131,
  F21: 132,
  F22: 133,
  F23: 134,
  F24: 135,
  NUMLOCK: 144,
  SCROLL: 145,
  LSHIFT: 160,
  RSHIFT: 161,
  LCONTROL: 162,
  RCONTROL: 163,
  LMENU: 164,
  RMENU: 165,
  BROWSER_BACK: 166,
  BROWSER_FORWARD: 167,
  BROWSER_REFRESH: 168,
  BROWSER_STOP: 169,
  BROWSER_SEARCH: 170,
  BROWSER_FAVORITES: 171,
  BROWSER_HOME: 172,
  VOLUME_MUTE: 173,
  VOLUME_DOWN: 174,
  VOLUME_UP: 175,
  MEDIA_NEXT_TRACK: 176,
  MEDIA_PREV_TRACK: 177,
  MEDIA_STOP: 178,
  MEDIA_PLAY_PAUSE: 179,
  MEDIA_LAUNCH_MAIL: 180,
  MEDIA_LAUNCH_MEDIA_SELECT: 181,
  MEDIA_LAUNCH_APP1: 182,
  MEDIA_LAUNCH_APP2: 183,
  OEM_1: 186,
  OEM_PLUS: 187,
  OEM_COMMA: 188,
  OEM_MINUS: 189,
  OEM_PERIOD: 190,
  OEM_2: 191,
  OEM_3: 192,
  OEM_4: 219,
  OEM_5: 220,
  OEM_6: 221,
  OEM_7: 222,
  OEM_8: 223,
  OEM_102: 226,
  OEM_103: 227,
  OEM_104: 228,
  PROCESSKEY: 229,
  PACKET: 231,
  OEM_ATTN: 240,
  OEM_FINISH: 241,
  OEM_COPY: 242,
  DBE_SBCSCHAR: 243,
  DBE_DBCSCHAR: 244,
  OEM_BACKTAB: 245,
  ATTN: 246,
  CRSEL: 247,
  EXSEL: 248,
  EREOF: 249,
  PLAY: 250,
  ZOOM: 251,
  NONAME: 252,
  PA1: 253,
  OEM_CLEAR: 254,
  UNKNOWN: 0,
  WLAN: 151,
  POWER: 152,
  ASSISTANT: 153,
  SETTINGS: 154,
  PRIVACY_SCREEN_TOGGLE: 155,
  BRIGHTNESS_DOWN: 216,
  BRIGHTNESS_UP: 217,
  KBD_BRIGHTNESS_DOWN: 218,
  KBD_BRIGHTNESS_UP: 232,
  ALTGR: 225,
  COMPOSE: 230,
  MEDIA_PLAY: 233,
  MEDIA_PAUSE: 234,
};
